home *** CD-ROM | disk | FTP | other *** search
-
- /*
- CLUTLess
- In some instances it is desireable to store picts stripped of
- CLUTs in order to save some room in the disk. This sample shows
- how to create such picts and how to properly display them back.
-
- SimpleInC.c -- initialization stuff and event loop
- CLUTLess.c -- code that does the creation of the clut less pict;
- shows also how to display the pictures.
-
- */
-
- /* all the includes we need. */
- #include <Desk.h>
- #include <Fonts.h>
- #include <Memory.h>
- #include <Resources.h>
- #include <StandardFile.h>
- #include <ToolUtils.h>
-
- /*
- * Resource ID constants.
- */
-
- #define appleID 128 /* This is a resource ID */
- #define fileID 129 /* ditto */
- #define editID 130 /* ditto */
- #define stuffID 131 /* same */
-
- #define appleMenu 0 /* MyMenus[] array indexes */
- #define aboutMeCommand 1
-
- #define fileMenu 1
- #define printCommand 1
- #define pageCommand 2
- #define quitCommand 3
-
- #define editMenu 2
- #define undoCommand 1
- #define cutCommand 3
- #define copyCommand 4
- #define pasteCommand 5
- #define clearCommand 6
-
- #define stuffMenu 3
- #define mUnmodPict 1
- #define mNoClutPict 2
- #define mClutPict 3
-
- #define menuCount 4
- /*
- * For the one and only text window
- */
- #define windowID 128
- /*
- * For DLOG's
- */
- #define aboutMeDLOG 128
-
- #define okButton 1
- #define authorItem 2 /* For SetIText */
- #define languageItem 3 /* For SetIText */
-
- #define SETRECT(rectp, _left, _top, _right, _bottom) \
- (rectp)->left = (_left), (rectp)->top = (_top), \
- (rectp)->right = (_right), (rectp)->bottom = (_bottom)
-
- #define HIWORD(aLong) (((aLong) >> 16) & 0xFFFF)
- #define LOWORD(aLong) ((aLong) & 0xFFFF)
-
-
- /*
- * Global Data objects, used by routines external to main().
- */
- MenuHandle MyMenus[menuCount]; /* The menu handles */
- Boolean DoneFlag; /* Becomes TRUE when File/Quit chosen */
- TEHandle TextH; /* The TextEdit handle */
-
- WindowRecord wRecord;
- WindowPtr myWindow; /* Referenced often */
-
- Rect pFrame;
-
- CQDProcs myProcs;
-
-
- extern PicHandle gOrigPict; // Holds the original picture
- extern PicHandle gModPict; // for the modified picture
- extern PicHandle gCurrPict; // pict to be used when updating the window
-
- CTabHandle gSharedClut; // we use this to create the 'clut' resource
- // later we use it for reading in the 'clut'
-
- /* protos */
-
- /* SimpleInC.c */
- void setupMenus(void);
- void showAboutMeDialog(void);
- void doCommand(long mResult);
-
- /* clutless.c */
- extern Boolean SetupPictures(void);
- extern pascal void AddColor(BitMap *src, Rect *srcR, Rect *dstR, short mode, RgnHandle msk);
- extern void InitProcs(CQDProcs *theProcs);
-
-